import 'package:aio/aio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:app/generated/app_strings.dart';
import 'package:app/src/http/bean/wroks/contract_bean.dart';
import 'package:app/src/http/bean/wroks/pay_free.dart';
import 'package:app/src/http/bean/wroks/pay_notice_bean.dart';
import 'package:app/src/ui/route/works/public/items/ui_base.dart';
import 'package:app/src/ui/route/works/public/items/ui_card.dart';

///免款审核，免款信息
class UiPayFreeInfo {
  ///data 信息
  ///oldData 历史信息
  static Widget build(
      BuildContext context, PayFree? data, PayFree? oldData,
      {String? title}) {
    List<Widget> children = [];
    if (StringUtils.isEmpty(title)) {
      title = AppStrings.of(context).PayFreeInfo; //免款信息
    }
    children.add(UiBase.title(context, title)); //标题
    children.add(UiBase.item(context, AppStrings.of(context).ApplicationCode,
        data?.ApplicationCode, oldData?.ApplicationCode)); //申请单号
    children.add(UiBase.item(context, AppStrings.of(context).AddDate3,
        data?.AddDate, oldData?.AddDate)); //入账日期
    children.add(UiBase.item(context, AppStrings.of(context).MerchandiserName2,
        data?.MerchandiserName, oldData?.MerchandiserName)); //跟单员
    children.add(UiBase.item(context, AppStrings.of(context).SalesmanName2,
        data?.SalesmanName, oldData?.SalesmanName)); //业务员
    children.add(UiBase.item(context, AppStrings.of(context).ContractCode,
        data?.ContractCode, oldData?.ContractCode)); //合同编号
    children.add(UiBase.item(context, AppStrings.of(context).OutCode,
        data?.OutCode, oldData?.OutCode)); //合同外部编号
    children.add(UiBase.item(context, AppStrings.of(context).ProjectName,
        data?.ProjectName, oldData?.ProjectName)); //项目名称
    children.add(UiBase.item(context, AppStrings.of(context).CustomerName,
        data?.CustomerName, oldData?.CustomerName)); //客户名称
    children.add(UiBase.item(context, AppStrings.of(context).FreeType,
        data?.FreeType, oldData?.FreeType)); //免款类型
    children.add(UiBase.item(context, AppStrings.of(context).Amount4,
        data?.Amount, oldData?.Amount)); //免款金额
    var column = UiBase.column(context, children);
    var card = UiCard.build(context, column);
    return card;
  }
}
